<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>折构赋值</title>
    </head>
    <body>
        <h1>折构赋值</h1>
        <p>来源:<a href="https://github.com/dvajs/dva-knowledgemap">https://github.com/dvajs/dva-knowledgemap</a></p>
        <script>
            // 对象
            const obj = {name:'yunhaonan',age:27,sex:'girl'};
            const {name, age} = obj;
            console.log(`${name},${age}`);
            // 数组
            const arr = ['深圳','广州','东莞'];
            const [city1,city2] = arr;
            console.log(`${city1},${city2}`);
            
        </script>
    </body>
</html>